<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>管理印章</title>
    <link rel="stylesheet" href="/asset/layui/css/layui.css">
    <link rel="stylesheet" href="/asset/css/index.css">
    <script src="/asset/layui/layui.js"></script>
    <link rel="Shortcut Icon" href="cachet.ico">
</head>
<body >
<div class="x-body">
<form class="layui-form">
	<input type="hidden" name="devicesUsedId" value="${used.devicesUsedId}">
	<div class="layui-form-item">
	    <div class="layui-inline">
	      <label class="layui-form-label">使用印章</label>
	      <div class="layui-input-inline layui-form-mid layui-word-aux">
	      	${used.seal.sealName}
	      </div>
	    </div>
	    <div class="layui-inline">
	      <label class="layui-form-label">使用设备</label>
	      <div class="layui-input-inline layui-form-mid layui-word-aux">
	      	${used.devices.alias}
	      </div>
	    </div>
	</div>
	<div class="layui-form-item">
	    <div class="layui-inline">
	      <label class="layui-form-label">使用人</label>
	      <div class="layui-input-inline layui-form-mid layui-word-aux">
	      	${used.person.name}
	      </div>
	    </div>
	    <div class="layui-inline">
	      <label class="layui-form-label">使用时间</label>
	      <div class="layui-input-inline layui-form-mid layui-word-aux">
	      	${used.usedTime?string("yyyy-MM-dd HH:mm:ss")}
	      </div>
	    </div>
	</div>
	<div class="layui-form-item">
	    <div class="layui-inline">
	      <label class="layui-form-label">使用状态</label>
	      <div class="layui-input-inline layui-form-mid layui-word-aux">
	      	
	      	<@linkage type="USED_STATUS" key=used.usedStatus>
        		<span class="${linkage.style}">${linkage.name}</span>
        	</@linkage>
	      </div>
	    </div>
	    <div class="layui-inline">
	      <label class="layui-form-label">使用IP</label>
	      <div class="layui-input-inline layui-form-mid layui-word-aux">
	      	${used.usedIp}
	      </div>
	    </div>
	</div>
	
	<div class="layui-form-item">
	      <label class="layui-form-label">使用凭证</label>
	      <div class="layui-input-block">
	      		<table class="layui-table mytable" lay-even="" lay-skin="nob">
	                <thead>
	                    <tr>
	                        <th>时间</th>
	                        <th>凭证</th>
	                        <th>状态</th>
	                    </tr>
	                </thead>
	                <tbody>
	                	<#list usedCerts as item>
	                    <tr>
	                        <td>${item.createTime?string("yyyy-MM-dd HH:mm:ss")}</td>
	                        <td>
	                        	<#list item.upfiles as item>
	                        	<img src="${item.fileUrl}" style="width:30px">
	                        	</#list>
	                        </td> 
	                        <td>${item.certStatus}</td>
	                    </tr>
	                    </#list>
	                </tbody>
	            </table>
	      </div>
	</div>
	
	<div class="layui-row text-center"> 
		<button class="layui-btn" lay-submit="" lay-filter="add">确认核查</button>
	</div>
	
  </div>
  </form>
</div>


<script>
        layui.use(['form','layer','laydate','upload'], function(){
            $ = layui.jquery;
          var form = layui.form,layer = layui.layer,laydate = layui.laydate,upload = layui.upload,element = layui.element;

          //监听提交
          form.on('submit(add)', function(data){
            var field = data.field;
            $.ajax({
      			type:"POST", 
      			url:"/custos/used/censor.htm",
      			data:field,
      			success:function(result) {
		      
		      		if(result.code=='1'){
		      			layer.alert("操作成功", {icon: 6},function () {
			                // 获得frame索引
			                 window.parent.location.reload();
			                var index = parent.layer.getFrameIndex(window.name);
			                //关闭当前frame
			                parent.layer.close(index);
			            });
		      		}else{
		      		 	layer.msg(result.msg);
		      		}
		      
		    	 } 
		    });
            
            return false;
          });
          
        });
    </script>


</body>
</html>